
/*WAP to pick up the largest largest no. from any 5 row by 5 column matrix*/

#include<stdio.h>
#include<conio.h>
void main()
{
	int a[3][5][5] = {
	  //  i  j  k
						{
							{1,  2,  33,  54, 65},
							{2,  0,  48, 584, 81},  //i = 0
							{3,  -25, 69, 28, 69},
							{4,  79, 105, 28, 89},
							{49, 7,  16,  25, 5008}
						},

						{
							{5,  6, 78, 29, 25},
							{8,  6, 5,  25,  14},
							{7,  8, 10, 58, 13},  //  i = 1
							{25, 5, 20, 14, 52},
							{58, 9, 103, 24, 25}
						},

						{
							{5,  6, -98, 25, 89},
							{2,  3, 59, 59, 54},
							{8,  9, 68, 39, 46},   //i = 2
							{47, 5, 12, 72, 16},
							{58, 9, 11, 58, 41}
						}
					 };

	int i, j, k, g = 0;

	clrscr();

	for(i = 0; i <= 2; i++)
	{
		for(j = 0; j <= 4; j++)
		{
			for(k = 0; k <= 4; k++)
			{
				if(i == 0 && j == 0 && k == 0)
				{
					g = a[i][j][k];
				}
				else
				{
					if(a[i][j][k] > g)
					{
						g = a[i][j][k];
					}
				}     //c[i][j] = a[i][j] + b[i][j] For Addition of 2 Matrix
			}
		}
	}
	printf("\n\tGratest No is = %d", g);

	getch();
}